package com.example.compreshensiveshop.service.ai.tools;

import com.example.compreshensiveshop.service.ProductService;
import dev.langchain4j.agent.tool.Tool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("productTools")
public class ProductTools {
    @Autowired
    private ProductService productService;
   @Tool("根据关键词查询商品信息")
   public String getProductByKeyword(String keyword) {
        return productService.getProductByKeyword(keyword).toString();
    }
    @Tool("根据商品分类查询商品信息")
    public String getProductByCategory(String category) {
        return productService.getProductByCategory(category).toString();
    }
}
